package com.atguigu.bigdata.scala.chapter04

import com.atguigu.bigdata.scala.bean.User

object Scala03_Flow {

    def main(args: Array[String]): Unit = {
        // TODO 循环 - for
        /*
           java :

           for ( int i = 0; i < 10; i++ ) {
               sout(i)
           }

           // JDK1.5
           for ( Object obj : list ) {
              sout(obj)
           }

           scala : 马丁开发了两门语言
         */

        // 基本的循环方式
        for ( i : Int <- 1 to 5 ) {
            //println(i)
        }

        for ( i : Int <- 1 to 5 by 2 ) {
            //println(i)
        }

        for ( i : Int <- 5 to 1 by -1 ) {
            println(i)
        }

    }
}
